<%@ page contentType="text/html;charset=GBK" pageEncoding="GBK" session="false" %><%@
	include file="/WEB-INF/jspf/import.jspf" %><%

	String module = request.getParameter("module");
	String suffix = "/upload_quick.jsp?";
	suffix = suffix + "command=53021&command=53022&command=53024&command=53025&keepSrc=true";
	pageContext.setAttribute("suffix", suffix);
%>
<script type="text/javascript" src="/js/upload/swfupload.js" charset="UTF-8"></script>
<script type="text/javascript" src="/admin/gift/handlers_gift.js" charset="UTF-8"></script>
<script type="text/javascript" src="/js/upload/swfupload.queue.js" charset="UTF-8"></script>
<script type="text/javascript">
var swfu;
var resizedImgCondition = "512KB";
var initswfu = function () {
	swfu = new SWFUpload({
		upload_url: "${UPCROOT}${suffix}",
		post_params:{
		    application: "${appName}",
		    waterMark: "/data/pc-config/upc/watermark/uc_auto.png",
		    "${cfg.userSessionName}":getUploadCookie("${cfg.userSessionName}")
		},
		// File Upload Settings
		file_size_limit: "10MB",
		file_types: "*.jpg;*.gif;*.jpeg;*.png;",
		file_types_description: "All Files",
		file_upload_limit: "0",
		use_query_string: true,

		swfupload_preload_handler: preLoad,
		swfupload_load_failed_handler: loadFailed,

		file_queue_error_handler: fileQueueError,
		file_dialog_complete_handler: fileDialogComplete,

		upload_progress_handler: uploadProgress,
		upload_error_handler: uploadError,
		upload_success_handler: uploadSuccess,
		upload_complete_handler: uploadComplete,

		// Button Settings
		button_placeholder_id: "spanButtonPlaceholder",
		button_width: 174,
		button_height: 39,
		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_cursor: SWFUpload.CURSOR.HAND,

		// Flash Settings
		flash_url: "/js/upload/swfupload.swf",
		flash9_url: "/js/upload/swfupload_fp9.swf",
		custom_settings:{
		    upload_target: "divFileProgressContainer",
		    resizedImgWidth: 700,
		    resizedImgHeight: 0,
		    resizedImgQuality: 100,
		    resizedImgCondition: resizedImgCondition
		},
		// Debug Settings
		debug:false
	});
};

function getUploadCookie(name, nounescape) {
     name=name+"=";
    var cookie_start = document.cookie.indexOf(name);
    var cookie_end = document.cookie.indexOf(";", cookie_start);
    if (cookie_start == -1) {
        return '';
    } else {
        var v = document.cookie.substring(cookie_start + name.length, (cookie_end > cookie_start ? cookie_end : document.cookie.length));
        return !nounescape ? unescape(v) : v;
    }
}
</script>